package com.example.demo.mapper;

import com.example.demo.entity.UserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper {
    List<UserEntity> getAll();

    List<UserEntity> getAllByIdOrder(@Param("ord") String ord);

    UserEntity getUserById(@Param("id") Integer id);

    UserEntity getUserByName(@Param("username") String username);

    UserEntity login(UserEntity user);

    int updatePassword(@Param("id") Integer id,
                       @Param("password") String password,
                       @Param("newPassword") String newPassword);
    int delById(@Param("id") Integer id);

    int addUser(UserEntity user);

    int addUserGetId(UserEntity user);

    int addUser2(UserEntity user);

    int addUser3(UserEntity user);

    // 模糊查询
    List<UserEntity> getListByName(@Param("username") String username);
}
